<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>
    console.log(null instanceof Object);
    console.log(["1","2","3"].map(parseInt));
    var val = 'smtg';
    console.log((val==='smtg')?'1':'2');
    var name = 'world';
    
    (function(){
        console.log(typeof name);
        if(typeof name ==='undefined'){
            var name = 'Jack';
            console.log('GoodBye'+name);
        }else {
            console.log('Hello'+ name);
        }
    })()

    // var end = Math.pow(2,53);
    // var start = end -100;
    // var count = 0 ;
    // for(var i = start;i<=end;i++){
    //     count++;
    // }
    // console.log(count);

    var two = 0.2;
    var one  = 0.1;
    var eight = 0.8;
    var six = 0.6;
    console.log(two-one==one);
    console.log(eight-six==two);

    function showCase(value) { 
        switch(value) {
            case 'A':
            console.log('Case A');
            break;
            case 'B':
            console.log('Case B');
            break;
            case undefined:
            console.log('undefined');
            break;
            default:
            console.log('do not know');
        }
     }
     showCase(new String('A'))

     function isOdd(num) { 
         return num % 2 == 1;
      }
      function isEven(num) { 
         return num % 2 == 0;
      }
      function isSane(num) { 
         return isEven(num) || isOdd(num);
      }
      var values = [7,4,'13',-9,Infinity];
      values.map(isSane);

    //   console.log(parseInt(3,8));
      console.log(parseInt(3,2));
      console.log(parseInt(3,0));

      function foo(a) { 
          var a ;
          return a;
       }
       function bar(a) { 
           var a = 'bye';
           return a
        }
        console.log(foo('hello'));
        console.log(bar('hello'));
</script>